#ifndef __GDL_LIST_H__
#define __GDL_LIST_H__

#include "gdl_types.h"
#include "gdl_macros.h"

GDL_BEGIN_DECLS

typedef struct _GDL_List GDL_List;

struct _GDL_List
{
	gdl_any_pointer data;
	GDL_List *next;
	GDL_List *prev;
};

GDL_List* gdl_list_alloc(void);

void gdl_list_free(GDL_List *list);

GDL_List* gdl_list_append(GDL_List *list, gdl_any_pointer data);

GDL_List* gdl_list_prepend(GDL_List *list, gdl_any_pointer data);

GDL_List* gdl_list_insert(GDL_List *list, gdl_any_pointer data, int position);

GDL_List* gdl_list_insert_sorted(GDL_List *list, gdl_any_pointer data, GDL_Compare_Func func);

GDL_List* gdl_list_insert_sorted_with_data(GDL_List *list, 
					   gdl_any_pointer data, 
					   GDL_Compare_Data_Func  func,
					   gdl_any_pointer user_data);

GDL_List* gdl_list_insert_before(GDL_List *list, GDL_List *sibling, gdl_any_pointer data);
/*
GList*   g_list_concat                  (GList            *list1,
   GList            *list2) G_GNUC_WARN_UNUSED_RESULT;
   GList*   g_list_remove                  (GList            *list,
   gconstpointer     data) G_GNUC_WARN_UNUSED_RESULT;
   GList*   g_list_remove_all              (GList            *list,
   gconstpointer     data) G_GNUC_WARN_UNUSED_RESULT;
   GList*   g_list_remove_link             (GList            *list,
   GList            *llink) G_GNUC_WARN_UNUSED_RESULT;
   GList*   g_list_delete_link             (GList            *list,
   GList            *link_) G_GNUC_WARN_UNUSED_RESULT;
   GList*   g_list_reverse                 (GList            *list) G_GNUC_WARN_UNUSED_RESULT;
   GList*   g_list_copy                    (GList            *list) G_GNUC_WARN_UNUSED_RESULT;
   */
GDL_List* gdl_list_nth(GDL_List *list, unsigned n);
/*
   GList*   g_list_nth_prev                (GList            *list,
   guint             n);
   GList*   g_list_find                    (GList            *list,
   gconstpointer     data);
   GList*   g_list_find_custom             (GList            *list,
   gconstpointer     data,
   GCompareFunc      func);
   gint     g_list_position                (GList            *list,
   GList            *llink);
   gint     g_list_index                   (GList            *list,
   gconstpointer     data);
   */
GDL_List* gdl_list_last(GDL_List *list);
/*
   GList*   g_list_first                   (GList            *list);
   guint    g_list_length                  (GList            *list);
   void     g_list_foreach                 (GList            *list,
   GFunc             func,
   gpointer          user_data);
   GList*   g_list_sort                    (GList            *list,
   GCompareFunc      compare_func) G_GNUC_WARN_UNUSED_RESULT;
   GList*   g_list_sort_with_data          (GList            *list,
   GCompareDataFunc  compare_func,
   gpointer          user_data)  G_GNUC_WARN_UNUSED_RESULT;
   gpointer g_list_nth_data                (GList            *list,
   guint             n);


#define g_list_previous(list)	        ((list) ? (((GList *)(list))->prev) : NULL)
#define g_list_next(list)	        ((list) ? (((GList *)(list))->next) : NULL)
*/
GDL_END_DECLS

#endif //end of __GDL_LIST_H__ define
